function newFirstProcessInfo(count, auditPerson, auditPersonName){
	var html = '<div class="smart-process_outem" id="processInfoDIV' + count + '">'
			+'	    <fieldset class="smart-process_fieldset">'
			+'	        <legend class="smart-process_legend"><span id="layerNum' + count + '"></span>级审核人员<i class="layui-icon">&#xe623;</i></legend>'
			+'	        <div class="layui-field-box smart-field-box">'
			+'	            <div class="smart-process_item">'
			+'	                <div class="smart-process_people">'
			+'	                    <span id="auditPerson' + count + '">' + auditPersonName + '</span>'
			+'	                    <input type="hidden" id="auditRecid' + count + '" name="auditRecid' + count + '" value="' + auditPerson + '"/>'
			+'	                </div>'
			+'	                <div class="smart-process_item_rt" style="right:-10px;">'
			+'	                    <div class="smart-process_addpeo" onclick="addAuditPerson(' + count + ');">+添加人员</div>'
			+'	                </div>'
			+'	            </div>'
			+'	        </div>'
			+'	    </fieldset>'
			+'	    <div class="smart-process_line">'
			+'	        <img src="./../images/home_v1/smart-down.png" alt="">'
			+'	    </div>'
			+'	</div>';
	$("#processInfoList").append(html);
}

function newProcessInfo(count, auditPerson, auditPersonName){
	var html = '<div class="smart-process_outem" id="processInfoDIV' + count + '">'
			+'	    <fieldset class="smart-process_fieldset">'
			+'	        <legend class="smart-process_legend"><span id="layerNum' + count + '"></span>级审核人员<i class="layui-icon">&#xe623;</i></legend>'
			+'	        <div class="layui-field-box smart-field-box">'
			+'	            <div class="smart-process_item">'
			+'	                <div class="smart-process_people">'
			+'	                    <span id="auditPerson' + count + '">' + auditPersonName + '</span>'
			+'	                    <input type="hidden" id="auditRecid' + count + '" name="auditRecid' + count + '" value="' + auditPerson + '"/>'
			+'	                </div>'
			+'	                <div class="smart-process_item_rt">'
			+'	                    <div class="smart-process_addpeo" onclick="addAuditPerson(' + count + ');">+添加人员</div>'
			+'	                    <div class="layui-btn smart-process-btn" onclick="deleteAuditPerson(' + count + ');"><i class="layui-icon">&#xe640;</i></div>'
			+'	                </div>'
			+'	            </div>'
			+'	        </div>'
			+'	    </fieldset>'
			+'	    <div class="smart-process_line">'
			+'	        <img src="./../images/home_v1/smart-down.png" alt="">'
			+'	    </div>'
			+'	</div>';
	$("#processInfoList").append(html);
}

function newStartProcess(count, auditPerson, auditPersonName){
	var html = '<div class="smart-process_outem" id="processInfoDIV' + count + '">'
			+'	    <fieldset class="smart-process_fieldset">'
			+'	        <legend class="smart-process_legend"><span id="layerNum' + count + '"></span>级审核人员<i class="layui-icon">&#xe623;</i></legend>'
			+'	        <div class="layui-field-box smart-field-box">'
			+'	            <div class="smart-process_item">'
			+'	                <div class="smart-process_people">'
			+'	                    <span id="auditPerson' + count + '">' + auditPersonName + '</span>'
			+'	                    <input type="hidden" id="auditRecid' + count + '" name="auditRecid' + count + '" value="' + auditPerson + '"/>'
			+'	                </div>'
			+'	                <div class="smart-process_item_rt">'
			+'	                    <div class="smart-process_addpeo" onclick="addAuditPerson(' + count + ');">+添加人员</div>'
			+'	                    <div class="layui-btn smart-process-btn" onclick="deleteAuditPerson(' + count + ');"><i class="layui-icon">&#xe640;</i></div>'
			+'	                </div>'
			+'	            </div>'
			+'	        </div>'
			+'	    </fieldset>'
			+'	    <div class="smart-process_line">'
			+'	        <img src="./../images/home_v1/smart-down.png" alt="">'
			+'	    </div>'
			+'	</div>';
	$("#processInfoList").html(html);
}

function changeActive(){
	 $('.smart-cell_ltdd').click(function () {
	        $('.smart-cell_ltdd').removeClass('active');
	        $(this).addClass('active');
	 });
}

var Utils={  
	    /* 
	        单位 
	    */  
	    units:'个十百千万@#%亿^&~',  
	    /* 
	        字符 
	    */  
	    chars:'零一二三四五六七八九',  
	    /* 
	        数字转中文 
	        @number {Integer} 形如123的数字 
	        @return {String} 返回转换成的形如 一百二十三 的字符串              
	    */  
	    numberToChinese:function(number){  
	        var a=(number+'').split(''),s=[],t=this;  
	        if(a.length>12){  
	            throw new Error('too big');  
	        }else{  
	            for(var i=0,j=a.length-1;i<=j;i++){  
	                if(j==1||j==5||j==9){//两位数 处理特殊的 1*  
	                    if(i==0){  
	                        if(a[i]!='1')s.push(t.chars.charAt(a[i]));  
	                    }else{  
	                        s.push(t.chars.charAt(a[i]));  
	                    }  
	                }else{  
	                    s.push(t.chars.charAt(a[i]));  
	                }  
	                if(i!=j){  
	                    s.push(t.units.charAt(j-i));  
	                }  
	            }  
	        }  
	        //return s;  
	        return s.join('').replace(/零([十百千万亿@#%^&~])/g,function(m,d,b){//优先处理 零百 零千 等  
	            b=t.units.indexOf(d);  
	            if(b!=-1){  
	                if(d=='亿')return d;  
	                if(d=='万')return d;  
	                if(a[j-b]=='0')return '零'; 
	            }  
	            return '';  
	        }).replace(/零+/g,'零').replace(/零([万亿])/g,function(m,b){// 零百 零千处理后 可能出现 零零相连的 再处理结尾为零的  
	            return b;  
	        }).replace(/亿[万千百]/g,'亿').replace(/[零]$/,'').replace(/[@#%^&~]/g,function(m){  
	            return {'@':'十','#':'百','%':'千','^':'十','&':'百','~':'千'}[m];  
	        }).replace(/([亿万])([一-九])/g,function(m,d,b,c){  
	            c=t.units.indexOf(d);  
	            if(c!=-1){  
	                if(a[j-c]=='0')return d+'零'+b ;
	            }  
	            return m;  
	        });  
	    }  
};

//流程操作审批下面的流程指示图
function addProcessContion(json){
	var auditDesc = json.AUDIT_DESC;
	var recTime = json.REC_TIME;
	var userName = json.USER_NAME;
	if(auditDesc == undefined){
		auditDesc = "";
	}
	if(recTime == undefined){
		recTime = "";
	}
	var className = '';
	if(json.AUDIT_STATE == "审核不通过"){
		className = 'state_reject';
	}else if(json.AUDIT_STATE == "审核通过"){
		className = 'state_success';
	}
	
	//多审核人员，把审核的那个人显著表示
	if(userName.indexOf(',') > 0 && json.AUDIT_STATE != '待审核'){
		var userNames = userName.split(",");
		var userNameTemp = '';
		for(var i = 0; i < userNames.length; i ++){
			if(userNames[i] == json.AUDIT_NAME){
				userNameTemp += '<font style="font-weight: bold;">' + userNames[i] + '</font>' + ",";
			}else{
				userNameTemp += userNames[i] + ",";
			}
		}
		userName = userNameTemp.substring(0, userNameTemp.length - 1);
	}
	
	var html = '<div class="smart-state_item">'
		+'        <div class="smart-state_cir ' + className +'">'
		+'    <i class="layui-icon">&#xe617;</i>'
		+'</div>'
		+'<div class="smart-state_content">'
		+'    <span class="smart-state_name">' + userName + '</span>'
		+'    <span class="sscsp ' + className +'">【' + json.AUDIT_STATE + '】</span>'
		+'    <span class="smart-state_reason">' + auditDesc + '</span>'
		+'    <p class="smart-state_time">' + recTime + '</p>';
		
	if(json.WORHER_NAME != '' && json.WORHER_NAME != null){
		html += '<p class="state_reject back">' + json.WORHER_NAME + '被驳回</p>';
	}
	html += '</div></div>';
	
	$("#processContion").append(html);
	
	if(json.AUDIT_STATE == "审核不通过"){
		completeHtml();
	}
	
}

//流程我的申请下面的流程指示图
function addProcessContionView(json){
	var auditDesc = json.AUDIT_DESC;
	var recTime = json.REC_TIME;
	var userName = json.USER_NAME;
	if(auditDesc == undefined){
		auditDesc = "";
	}
	if(recTime == undefined){
		recTime = "";
	}
	var className = '';
	if(json.AUDIT_STATE == "审核不通过"){
		className = 'state_reject';
	}else if(json.AUDIT_STATE == "审核通过"){
		className = 'state_success';
	}
	
	//多审核人员，把审核的那个人显著表示
	if(userName.indexOf(',') > 0 && json.AUDIT_STATE != '待审核'){
		var userNames = userName.split(",");
		var userNameTemp = '';
		for(var i = 0; i < userNames.length; i ++){
			if(userNames[i] == json.AUDIT_NAME){
				userNameTemp += '<font style="font-weight: bold;">' + userNames[i] + '</font>' + ",";
			}else{
				userNameTemp += userNames[i] + ",";
			}
		}
		userName = userNameTemp.substring(0, userNameTemp.length - 1);
	}
	
	var html = '<div class="smart-state_item">'
		+'        <div class="smart-state_cir ' + className +'">'
		+'    <i class="layui-icon">&#xe617;</i>'
		+'</div>'
		+'<div class="smart-state_content">'
		+'    <span class="smart-state_name">' + userName + '</span>'
		+'    <span class="sscsp ' + className +'">【' + json.AUDIT_STATE + '】</span>'
		+'    <span class="smart-state_reason">' + auditDesc + '</span>'
		+'    <p class="smart-state_time">' + recTime + '</p>';
		
	if(json.WORHER_NAME != '' && json.WORHER_NAME != null){
		html += '<p class="state_reject back">' + json.WORHER_NAME + '被驳回</p>';
	}
	html += '</div></div>';
	
	$("#processContion").append(html);
	
}

function completeHtml(){
	var html = '<div class="smart-state_item over">'
             + '        <div class="smart-state_cir">'
             + '    <i class="layui-icon">&#xe616;</i>'
             + '</div>'
             + '<div class="smart-state_content">'
             + '    <span class="smart-state_name">完成</span>'
             + '</div>'
             + '</div>';
	$("#processContion").append(html);
}